import requests
from libnum import *

def factorize(n):
    l = []
    url="http://factordb.com/api?query="+str(n)
    r = requests.get(url)
    data = r.json()   
    for factor in data['factors']:
        for i in range(int(factor[1])):
            l.append(int(factor[0]))
    return l

def getPhi(p_list):
    phi = 1
    for p in p_list:
        phi *= (p-1)
    return phi

n = 2627832721798532654645633759787364870195582649392807630554510880534973280751482201937816738488273589173932960856611147584617677312265144131447658399933331448791094639659769069406481681017795446858858181106274806005669388289349727511470680972
c = 96830301447792999743877932210925094490214669785432172099311147672020980136112114653571739648595225131425493319224428213036136642899189859618195566355934768513439007527385261977662612094503054618556883356183687422846428828606638722387070581
e = 0x10001
phi = getPhi(factorize(n))
d = invmod(e, phi)
m = pow(c, d, n)
flag = n2s(m).decode()
print(flag) # flag{D4mn_e45y_eCC_4Nd_R54_m1XeD}